/*==============================================================================
             Copyright (c) 2009 - All rights reserved
================================================================================
File description:

    Graphics platform function definition

================================================================================
      Date            Name                    Description of Change
24-Aug-2009  Xiaofeng.Gu                    Written
$HISTORY$
==============================================================================*/

#pragma once

#include "GViewer.h"
#include "GraphicsManager.h"
#include "GBox.h"

class CGraphPlotter;

class CGraphicsPlatform
{
public:
	CGraphicsPlatform();
	virtual~ CGraphicsPlatform();

	virtual bool					OnInitialize(CView* pView) { return true; }
	virtual void					OnRender() { return; }
	virtual void					OnSize(int cx, int cy);

	virtual void					Translate2DTo3D(int iPtX, int iPtY, CVec& pt) { return; }
	virtual void					Translate3DTo2D(const CVec& pt, int& iPtX, int& iPtY) { return; }

	CGViewer*						GetViewer() { return m_pGViewer; }
	CGraphicsManager*				GetManager() { return &m_oGraphicsMgr; }
	CGraphPlotter*					GetGraphPlotter() { return m_pGraphPlotter; }

	void							Fit(IGraphics* pGraphics);

protected:
	CGraphicsManager				m_oGraphicsMgr;
	CGViewer*						m_pGViewer;
	CGraphPlotter*					m_pGraphPlotter;

	CDC*							m_pDC;
	HGLRC							m_hRC;

	// Clear colors
	float							m_ClearColorRed;
	float							m_ClearColorGreen;
	float							m_ClearColorBlue;

	// Size
	float							m_fRadius;
	double							m_dAspectPrint;
	double							m_dNearPlane;
	double							m_dFarPlane;
	double							m_dMaxObjSize;
	double							m_dAspect;
};